import setting from "@/config/setting";
import qs from 'qs';

export function download(url, data, open = true) {
  const token = setting.takeToken().substr(7)
  const openUrl = process.env.VUE_APP_API_BASE_URL + url + '?_t=' + token + '&_=' + new Date().getTime() + '&' + qs.stringify(data)
  if (!open) {
    return openUrl
  }
  window.open(openUrl)
}